package com.lry.future;

import java.util.concurrent.*;

/**
 * @author JiangJie
 * @create 2020-11-23 12:31
 */
public class Demo1 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService exec=Executors.newCachedThreadPool();

        Future<String> st=exec.submit(new Callable<String>() {
            @Override
            public String call() throws Exception {
                Thread.sleep(2000);
                return "daf";
            }
        });

        System.out.println(st.get());
    }
}
